package com.company;

import java.util.ArrayList;

/**
 * Created by elimydlarz on 14/04/14.
 */
public class FactorGenerator {

    public ArrayList<Integer> generate(Integer n) {
        ArrayList<Integer> factors = new ArrayList<Integer>();
        Integer possibleFactors = n / 2;

        for (int i = 2; i <= possibleFactors; i++) {
            if (n % i == 0) factors.add(i);
        }

        return factors;
    }
}
